﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Threading.Tasks;

namespace JXC.Core.Models
{
    /// <summary>
    /// 采购入库单主文件
    /// </summary>
    public class CaigouEnter
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid Id { get; set; }//采购入库单单号
       
        //public Guid SupplierId { get; set; } //供应商Id
        public string Monetary { get; set; }//货币

        public DateTime BuyDate { get; set; }//采购日期
     
        public Guid BuyerID { get; set; }//采购人
        [ForeignKey("CaigouOrderId")]
        public Guid CaiGouOrderID { get; set; }//采购订单单号
       
        public Guid OperatorID { get; set; }//操作员

        public DateTime EnterDate { get; set; }//录入日期

        [ForeignKey("UserInfosId")]
        public Guid? OpmanlID { get; set; }//修改人

        public DateTime? Opdate { get; set; }//修改日期

        [ForeignKey("UserInfosId")]
        public Guid? ExaminerID { get; set; }//审核人

        public DateTime? ExamineDate { get; set; }//审核日期
        public string? Others { get; set; }//备注

        public int ExamineState { get; set; }//审核状态



        public UserInfos Buyer { get; set; }//采购人
        public UserInfos Opmanl { get; set; }//修改人

        public UserInfos Examiner { get; set; }//审核人

        public virtual UserInfos Operator { get; set; }//操作员

        public ICollection<CaigouStorageDetails> CaigouStorageDetails { get; set; } = new List<CaigouStorageDetails>();

        //public CaigouOrder CaigouOrder { get; set; }
        //public Supplier Supplier { get; set; }

    }
}
